using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;

namespace ProjectView.ProjectControls
{
	public partial class UCProjectBasicInfo : UserControl, IComponentConnector
	{
		public static readonly DependencyProperty IsShowUnitNameProperty = DependencyProperty.Register("IsShowUnitName", typeof(bool), typeof(UCProjectBasicInfo), new PropertyMetadata(true, OnIsShowUnitNameChanged));

		public bool IsShowUnitName
		{
			get
			{
				return (bool)GetValue(IsShowUnitNameProperty);
			}
			set
			{
				SetValue(IsShowUnitNameProperty, value);
			}
		}

		private static void OnIsShowUnitNameChanged(object sender, DependencyPropertyChangedEventArgs args)
		{
			(sender as UCProjectBasicInfo).setTextVisibility();
		}

		public UCProjectBasicInfo()
		{
			InitializeComponent();
		}

		public void setTextVisibility()
		{
			if (!IsShowUnitName)
			{
				label7_Copy.Visibility = Visibility.Collapsed;
			}
		}
	}
}
